package com.eshop.enums;

import java.util.stream.Stream;

public enum SortEnum
{
    DESC("desc", "降序"), 
    ASC("asc", "升序");
    
    private String value;
    private String desc;
    
    public static SortEnum toType(final String value) {
        return Stream.of(values()).filter(p -> p.value == value).findAny().orElse(null);
    }
    
    public String getValue() {
        return this.value;
    }
    
    public String getDesc() {
        return this.desc;
    }
    
    private SortEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }
}
